﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.platform.pojo.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>南京化工职业技术学院资源共享平台--个人中心</title>
<link href="<%=basePath%>res/css/css.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<%=basePath%>res/js/jquery-1.2.6.js"></script>
<script type="text/javascript">
	function check() {
		var orginPasswd = $("#orginPasswd").val();
		var newPasswd = $("#newPasswd").val();
		var confirmPasswd = $("#confirmPasswd").val();
		if(orginPasswd == null || $.trim(orginPasswd) == "") {
			alert("请填写原密码！");
			return false;
		}
				
		if(!/^[a-zA-Z0-9_]+$/g.test($.trim(orginPasswd))) {
			alert("密码只能是数字，字母和下划线！");
			return false;
		}
		if(newPasswd == null || $.trim(newPasswd) == "") {
			alert("请填写新密码！");
			return false;
		}
		
		if($.trim(newPasswd).length < 6) {
			alert("密码长度不可少于6位！");
			return false;
		}
				
		if($.trim(newPasswd).length > 24) {
			alert("密码长度不可超过24位！");
			return false;
		}
		if(!/^[a-zA-Z0-9_]+$/g.test($.trim(newPasswd))) {
			alert("密码只能是数字，字母和下划线！");
			return false;
		}
		if($.trim(orginPasswd) == $.trim(newPasswd)) {
			alert("原密码与新密码不可相同！");
			return false;
		}
		if(confirmPasswd == null || $.trim(confirmPasswd) == "") {
			alert("请填写密码确认！");
			return false;
		}
		if($.trim(newPasswd) != $.trim(confirmPasswd)) {
			alert("两次密码填写不一致！");
			return false;
		}
		return true;
	}
</script>
</head>
<body>
<div id="header">
   <div id="top">
		<ul>
		  <li><marquee onmouseover=this.stop() onmouseout=this.start()>今日访问：${accessCount }&nbsp;&nbsp;共享资源总数：${resCount }&nbsp;&nbsp;注册用户总数：${userCount }&nbsp;&nbsp;资源共享达人：${daUser.realName }&nbsp;&nbsp;资源下载热度：${faRes.name }</marquee></li>
		</ul>
   </div>
   <div id="bottom">
       <div id="bleft"><img src="<%=basePath%>res/images/share_05.jpg" width="387" height="65" />
       </div>
       <div id="bright">
            <ul>
            	<c:if test="${empty user}">
                 <li><a href="javascript:window.location.href='<%=basePath%>login.jsp?refreshurl=entry.jsp';"><img src="<%=basePath%>res/images/share_08.jpg" width="31" height="18" /></a>&nbsp;&nbsp;
                 	<a href="javascript:window.location.href='<%=basePath%>register.jsp?refreshurl=entry.jsp';"><img src="<%=basePath%>res/images/share_1.jpg" width="31" height="18" /></a>&nbsp;&nbsp;
                 	<a href="javascript:window.location.href='<%=basePath%>retrieve.jsp';">忘记密码？</a>
                 </li>
                 </c:if>
            	<c:if test="${!empty user}">
                 <li>
                 	<h2>${user.realName }，欢迎回来！</h2><h2><a href="<%=basePath%>njcc/loadUserInfo.action" style="color:red;">个人中心，</a></h2>&nbsp;&nbsp;<h2><a href="<%=basePath%>njcc/logout.action">点击退出！</a></h2>
                 </li>
                 </c:if>
            </ul>
       </div>
   </div>
</div>
<div id="content">
     <div id="cleft">
          <div id="dh1"></div>
                <div id="dhc1">
                    <ul>
                        <li><a href="<%=basePath%>njcc/loadUserInfo.action">个人信息</a></li>
                        <li><a href="javascript:window.location.href='<%=basePath%>resetpasswd.jsp'">修改密码</a></li>
                        <li><a href="javascript:window.location.href='<%=basePath%>editinfo.jsp'">编辑个人信息</a></li>
                        <li><a href="<%=basePath%>njcc/loadCustomResList.action?type=myupload">我上传的资源</a></li>
                        <li><a href="<%=basePath%>njcc/loadCustomResList.action?type=mydownload">我下载的资源</a></li>
                  </ul>
                </div>
                <img src="<%=basePath%>res/images/left_08.jpg" width="192" height="16" />
          </div>
  <div id="cright">
                
                	<div id="location"><a class="blue" href="<%=basePath%>entry.jsp">首页</a>
				                		<span class="blue"> >> </span>个人中心
				    </div>

         <!--正文开始 -->
			 <div class="all-yonghu">
                    <div class="yonghu" style="padding:10px;width:100%;">
                    	<form action="<%=basePath%>njcc/resetPasswd.action" method="post" onsubmit="javascript:return check();">
	                    	<table style="width:50%;">
	                    		<tr>
	                    			<td style="width:120px;">原密码：</td>
	                    			<td><input type="password" name="orginPasswd" id="orginPasswd" style="border:1px solid black;" /></td>
	                    		</tr>
	                    		<tr>
	                    			<td>新密码：</td>
	                    			<td><input type="password" name="newPasswd" id="newPasswd" style="border:1px solid black;" /></td>
	                    		</tr>
	                    		<tr>
	                    			<td>确认新密码：</td>
	                    			<td><input type="password" name="confirmPasswd" id="confirmPasswd" style="border:1px solid black;" /></td>
	                    		</tr>
	                    		<tr style="text-align: center;">
	                    			<td><input style="border: #bbb 1px solid;" type="submit" name="submit" id="submit" value="修改密码" /></td>
	                    			<td><input style="border: #bbb 1px solid;" type="reset" name="reset" id="reset" value="取消" /></td>
	                    		</tr>
	                    	</table>
                    	</form>
                    </div>   
         <!--正文结束 -->
	</div>
  </div>
</div>
<div id="guanggao1">
<img src="<%=basePath%>res/images/share_44.jpg" width="900" height="95" /></div>
<div id="banquan">
           <ul>
                 <li>南京化工职业技术学院--资源共享网 <img src="<%=basePath%>res/images/pic.gif" width="50" height="12" /></li>           
                 <li>诚聘英才 | 友情链接 | 联系我们</li> 
                 <li>版权所有©南京化工职业技术学院 ICP：沪B2-20030192 </li>
  </ul>
</div>
</body>
</html>
